﻿using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Util;
using Android.Views;
using Android.Widget;
using Android.OS;
//using Xamarin.Media;

namespace dCamera.demo
{
    [Activity(Label = "dCamera.demo", MainLauncher = true, Icon = "@drawable/icon")]
    public class Activity1 : Activity
    {
        int count = 1;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button>(Resource.Id.MyButton);
            var btnShot = FindViewById<Button>(Resource.Id.btnShot);

            btnShot.Click += new EventHandler(btnShot_Click);

            button.Click += delegate
            {
                //button.Text = string.Format("{0} clicks!", count++);
                StartActivity(typeof(wc));
            };
        }

        void btnShot_Click(object sender, EventArgs e)
        {
            //Xamarin.Media.MediaPicker mp=new MediaPicker(this);
            //var scop = new StoreCameraMediaOptions();
            
            //if (mp.IsCameraAvailable)
            //{
            //    mp.TakePhotoAsync(scop).ContinueWith(OnTakePhoto);
            //}
        }

        void OnTakePhoto(IAsyncResult result)
        {
            Log.Debug("TTT:", result.IsCompleted.ToString());
        }
    }
}

